<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>k2d-3d</title>
    <style>
        #info {
			background-color: rgba(0,0,0,0.75);
		}

		.lil-gui .gui-stats {
			line-height: var(--widget-height);
			padding: var(--padding);
		}
        .top-label{
            background-color: blue;
            color: white;
            font-size: 16px;
        }
        body {
            font-family: Monospace;
            background-color: #fff;
            color: #000;
            margin: 0px;
        }
        .lil-gui{
            position: relative;
            line-height: calc(var(--title-height) + 4px);
            height: calc(var(--title-height) + 8px);
        }
        .lil-gui.root>.children{
            position: relative;
        }
        .lil-gui.root>.children>.controller{
            z-index: 99;
            padding: 5px 20px;
            margin: 0;
            background-color: var(--background-color);
        }
        .lil-gui{
            --scrollbar-width: 0;
        }
        .lil-gui.root>.children>.controller.function{
            z-index: 99;
            padding: 16px 20px 16px 20px;
            border-radius: 4px;
            background-color: var(--background-color);
        }
        .lil-gui.root>.children>.controller.function button{
            height: 28px;
            background-color: #424242;
        }
        .lil-gui.root>.children>.controller.function button:hover{
            height: 28px;
            background-color: #0091ff;
        }
        .lil-gui.root>.children>.controller:nth-child(1){
            position: sticky;
            padding-top: 16px;
            top: 0px;
        }
        .lil-gui.root>.children>.controller:nth-child(2){
            position: sticky;
            top: 30px;
        }
        .lil-gui.root>.children>.controller:nth-child(3){
            position: sticky;
            top: 60px;
        }
        .lil-gui.root>.children>.controller:nth-child(4){
            position: sticky;
            top: 90px;
        }
        .lil-gui.root>.children>.controller:nth-child(5){
            position: sticky;
            top: 120px;
        }
        .lil-gui.root>.children>.controller:nth-child(6){
            position: sticky;
            top: 150px;
        }
        .lil-gui.root>.children>.controller:nth-child(7){
            position: sticky;
            top: 180px;
        }
        .lil-gui.root>.children>.controller:nth-child(8){
            position: sticky;
            top: 210px;
        }
        .lil-gui.root>.children>.controller:nth-child(9){
            position: sticky;
            top: 240px;
        }
        option {
            background-color: var(--background-color);
        }
        select{
            background-color: var(--background-color);
        }
        .lil-gui .controller{
            padding: 2px 20px;
            background-color: var(--background-color);
        }
        .lil-gui .title:before{
            display: none;
        }
        .lil-gui .title{
            padding: 2px 20px;
            line-height: calc(var(--title-height));
            height: calc(var(--title-height) + 4px);
        }
        .lil-gui .lil-gui .controller.anime-title{
            border-top: 1px solid #424242;
        }
        .lil-gui .lil-gui .controller.anime-title:first-child{
            border-top: none;
        }
        .lil-gui .title:after{
            font-family: "lil-gui";
            content: "▾";
            padding-right: 2px;
            position: absolute;
            right: 8px;
            display: inline-block;
        }
        .lil-gui.closed>.title:after {
            content: "▸";
        }
        .box{
			position: relative;
            width: 100%;
            height: 100%;
            width: 100vw;
            height: 100%;
        }
        .canvas-warp{
            width: 100vw;
            height: 100%;
            width: 100%;
            height: 100%;
        }
        .canvas-warp canvas{
            width: 100vw;
            height: 100%;
        }
        .box .actions {
            position: absolute;
			user-select: none;
			text-align: center;
			line-height: 22px;
			border-radius: 4px;
			cursor: pointer;
			right: 16px;
			bottom: 30px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .box .actions >div{
            background: #c3c7cb;
            padding: 4px;
            border-radius: 2px;
            font-size: 18px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .box .restore {
            display: none;
			position: absolute;
			user-select: none;
			width: 32px;
			height: 32px;
			background: #c3c7cb;
			font-size: 30px;
			text-align: center;
			line-height: 32px;
			border-radius: 4px;
			cursor: pointer;
            overflow: hidden;
			right: 16px;
			bottom: 10px;
		}
        .lil-gui.root>.children>.lil-gui>.title{
            background-color: #424242;
            border-color: #1f1f1f;
        }

        .box .reset {
			position: absolute;
			user-select: none;
            box-shadow: 1px 1px 1px #e3e3e3;
			width: 32px;
			height: 32px;
			background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
			font-size: 30px;
			text-align: center;
			line-height: 32px;
			border-radius: 4px;
			cursor: pointer;
            overflow: hidden;
			right: 16px;
			bottom: 50px;
		}
        .box .reset svg {
            width: 32px;
            height: 32px;
        }
        option{
            background-color: white;
        }

        .label{
                margin-top: -1em;
                border: thin solid yellow;
                background-color: #FE5E86;
                border-radius: 2px;
                padding: 2px 5px;
                font-size: 12px;
                color: white;
            }
    </style>
</head>

<body>
    <div class="box" id="box">
        <div class="canvas-warp" id="warp"></div>
        <div class="actions">
            <div class="plus" onclick="turnAC('on')">空调灯开</div>
            <div class="plus" onclick="turnAC('off')">空调灯关</div>
            <div class="plus" onclick="turnAC('cold')">空调灯制冷</div>
            <div class="plus" onclick="turnAC('hot')">空调灯制热</div>
            <div class="plus" onclick="turnLight('on')">照明灯开</div>
            <div class="plus" onclick="turnLight('off')">照明灯关</div>
            <div class="plus" onclick="turnAlarm('on')">报警灯开</div>
            <div class="plus" onclick="turnAlarm('off')">报警灯关</div>
            <div class="plus" onclick="openDoor('C大门')">开C大门</div>
            <div class="reduce" onclick="closeDoor('C大门')">关C大门</div>
            <div class="plus" onclick="openDoor('D大门')">开D大门</div>
            <div class="reduce" onclick="closeDoor('D大门')">关D大门</div>
        </div>
        
    </div>
</body>
<script>
    // window.addEventListener('mousewheel', (evt) => {evt.preventDefault()}, {
    //     capture: true,
    //     passive: false,
    //     once: false
    // });
	function openDoor(flag) {
		window.app.scene.openDoor(flag)
	}

    function turnAC(status){
        window.app.scene.turnAC(status)
    }
    function turnLight(status) {
        window.app.scene.turnLight(status)
    }
    function turnAlarm(status) {
        window.app.scene.turnAlarm(status)
    }
    function closeDoor(flag) {
        window.app.scene.closeDoor(flag)
    }
</script>
</html>